/***************************************************************************

-------------------
    begin                : 
    copyright            : kuzkok
    email                : kuzkok at gmail.com

***************************************************************************
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or     *
*   (at your option) any later version.                                   *
*   
*   Данная программа является свободным программным обеспечением;         *
*   Вы можете распространять ее и/или модифицировать в соответствии с     *
*   GNU General Public License опубликованной Фондом свободного           *
*   программного обеспечения; используемая версия лицензии - 2 или        *
*   (по вашему выбору) любая более поздняя                                *
***************************************************************************/

#ifndef FITTING_H
#define FITTING_H

#include "onlinepointfacility.h"

class Fitting : public OnlinePointFacility
{
    Q_OBJECT
public:
    explicit Fitting(QString tableName);
    Fitting(QUuid theEventID, QString tableName);

    QDate dateManufactured()
    {
        return mDateManufactured;
    }

    QUuid grade()
    {
        return mGrade;
    }

    QUuid inletConnectionType()
    {
        return mInletConnectionType;
    }

    QUuid manufacturer()
    {
        return mManufacturer;
    }

    QUuid material()
    {
        return mMaterial;
    }

    QUuid pressureRating()
    {
        return mPressureRating;
    }

    QUuid specification()
    {
        return mSpecification;
    }

    double inletDiameter()
    {
        return mInletDiameter;
    }

    double inletWallThikness()
    {
        return mInletWallThikness;
    }


signals:

public slots:
    void setDateManufactured(QDate value)
    {
        mDateManufactured = value;
    }

    void setInletConnectionType(QUuid value)
    {
        mInletConnectionType = value;
    }

    void setManufacturer(QUuid value)
    {
        mManufacturer = value;
    }

    void setMaterial(QUuid value)
    {
        mMaterial = value;
    }

    void setPressureRating(QUuid value)
    {
        mPressureRating = value;
    }

    void setSpecification(QUuid value)
    {
        mSpecification = value;
    }

    void setInletDiameter(double value)
    {
        mInletDiameter = value;
    }

    void setInletWallThikness(double value)
    {
        mInletWallThikness = value;
    }

protected:
    void buildInsertStatement();
    void buildUpdateStatement();
    void bindQueryValues(QSqlQuery &query);

private:
    QDate mDateManufactured;
    QUuid
            mGrade,
            mInletConnectionType,
            mManufacturer,
            mMaterial,
            mPressureRating,
            mSpecification;
    double
            mInletDiameter,
            mInletWallThikness;

};

#endif // FITTING_H
